<template>
  <svg aria-hidden="true" :style="`width:${size}px; height:${size}px`">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script name='SvgIcon' , setup lang="ts">
import { computed } from 'vue';

const props = defineProps({
  prefix: {
    type: String,
    default: 'icon',
  },
  name: {
    type: String,
    required: true,
  },
  color: {
    type: String,
    default: '#333',
  },
  size: {
    type: Number || String,
    default: 14,
  },
})
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>

<style scoped></style>
